---
category: Object
contributors:
    - Namysh
created: '2020-05-13'
title: Shallow copy an object
updated: '2020-07-16'
---

**JavaScript version**

```js shallowCopy.js
const shallowCopy = obj => Object.assign({}, obj);

// or
const shallowCopy = obj => {...obj};
```
